#include <func.h>

int main(int argc, char* argv[])
{
    int fd = open("a.txt", O_RDWR | O_CREAT | O_APPEND, 0666);
    if (fd == -1) {
        perror("open()");
        exit(1);
    }

    printf("fd: %d\n", fd);

    write(fd, "Hello world\n", 12);
    lseek(fd, 0, SEEK_SET);
    write(fd, "I love xixi\n", 12);

    return 0;
}

